package com.baidu.mpks.exception;

public class FriendlyBusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;
    private String title;
    private String detail;

    public FriendlyBusinessException(String msg) {
        super(msg);
        this.title = msg;
        this.detail = "";
    }

    /**
     * 
     * @param title  将会在前端界面显示的描述
     * @param detail 方便定位问题的描述
     */
    public FriendlyBusinessException(String title, String detail) {
        super(String.format("%s: %s", title, detail));
        this.title = title;
        this.detail = detail;
    }

    public String getTitle() {
        return title;
    }

    public String getDetail() {
        return detail;
    }
}